package cn.com.nes.site.service.project.handler;

import cn.com.nes.site.service.project.ProjectServiceUserAuthService;
import cn.com.nes.site.service.project.TProjectService;
import cn.com.nes.site.service.project.bo.QueryInstallWorkAreaBO;
import cn.com.nes.site.service.system.user.SystemUserService;
import cn.com.nes.site.service.workOrder.WorkOrderService;
import cn.hutool.core.collection.CollectionUtil;
import lombok.Data;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.HashSet;
import java.util.Set;

/**
 * 工作区域处理器
 */
@Data
@Component
public abstract class WorkAreaHandler {

    @Resource
    protected TProjectService tProjectService;

    @Resource
    protected SystemUserService systemUserService;

    @Resource
    protected ProjectServiceUserAuthService projectServiceUserAuthService;

    @Resource
    protected WorkOrderService workOrderService;
    /**
     * 下一个环节
     */
    protected WorkAreaHandler successor;

    /**
     * 查询安装工单行政区划代码
     */
    public Set<String> queryInstallWorkArea(QueryInstallWorkAreaBO queryBO) throws Exception {
        return CollectionUtil.isNotEmpty(queryBO.getAreaCodeSet()) ? queryBO.getAreaCodeSet() : new HashSet<>();
    }
}
